package com.example.qzzm;

import java.util.ArrayList;
import java.util.List;

import com.example.qzzm.R;
import com.example.view.MyHorizontalScrollView;
import com.viewpager.SlideShowView;

import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;
import android.app.Activity;
import android.graphics.BitmapFactory;
import android.os.Bundle;

/**
 * 主界面的Activity
 * 
 * @author Administrator
 *
 */
public class ImgActivity extends Activity {
	// 登录按钮
	private ImageView ivBack;
	ArrayList<String> pic_list = new ArrayList<String>();
	private MyHorizontalScrollView svImage;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_images);

		Bundle bundle = getIntent().getExtras();
		if (!bundle.containsKey("imgs")) {
			finish();
		}
		pic_list = bundle.getStringArrayList("imgs");
		System.out.println(pic_list);
		initView();
		initListeners();
	}

	// 初始化布局控件
	private void initView() {
		ivBack = (ImageView) findViewById(R.id.iv_back);
		svImage = (MyHorizontalScrollView) findViewById(R.id.sv_img);
		svImage.setContentUrls(pic_list);
	}

	// 初始化监听事件
	private void initListeners() {
		ivBack.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				finish();
			}
		});
	}
}
